package com.atguigu.func;

import com.atguigu.bean.WaterSensor;
import org.apache.flink.api.common.functions.MapFunction;

/**
 * @author Felix
 * @date 2024/7/10
 */
public class WaterSensorMapFunction  implements MapFunction<String, WaterSensor> {
    @Override
    public WaterSensor map(String lineStr) throws Exception {
        String[] fieldArr = lineStr.split(",");
        return new WaterSensor(fieldArr[0],Long.valueOf(fieldArr[1]),Integer.valueOf(fieldArr[2]));
    }
}
